import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeChildren from './modules'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'HelloWorld',
    component: () => import(/* webpackChunkName: "HelloWorld" */ '@/pages/HelloWorld.vue')
  },
  {
    path: '/index',
    name: 'Home',
    component: () => import(/* webpackChunkName: "home" */ '@/pages/Home.vue'),
    children: [
      ...HomeChildren
    ]
  },
  {
    path: '/index/:id',
    name: 'HomeId',
    component: () => import(/* webpackChunkName: "home" */ '@/pages/Home.vue')
  },
  {
    path: '/*',
    redirect: '/index'
  }
]

const router = new VueRouter({
  routes
})

export default router
